<?php

class LikeMVC_Utils_Common {

	/**
	 * Convert name to class. 
	 * It will convert the first character to uppercase
	 * E.g: registry will be converted to Registry
	 */
	public static function convertNameToClass($name)	{
		return strtoupper(substr($name, 0, 1)).substr($name, 1);
	}
	
	/**
	 * Convert name to class file. 
	 * Similar to the convertNameToClass method, except that it 
	 * will append ".php" (without the quote) to the end of the result
	 * E.g: registry will be converted to Registry.php
	 */
	public static function convertNameToClassFile($name)	{
		return self::convertNameToClass($name).".php";
	}
	
	/**
	 * Convert name to directory. 
	 * It will convert all characters to lowercase
	 * E.g: RegistrY will be converted to registry
	 */
	public static function convertNameToDirectory($name)	{
		return strtolower($name);
	}
	
	public static function convertClassToPath($class)	{
		$path = str_replace("_", "/", $class);
		return $path.".php";
	}
}

?>